
const data_config = require("./data_config");


module.exports = {
  nav_name: '测试', //生成导航菜单
  module_name: 'test_m',  //生成路径，必须与文件名相同
  api: `{
    page: commonPath + "/admin/shopgood/page", //分页
    detail: commonPath + '/admin/shopgood/get', //详情,
    add: commonPath + '/admin/shopgood/add', //添加
    del: commonPath + '/admin/shopgood/del', //删除
    edit: commonPath + '/admin/shopgood/update', //修改
    changeState: commonPath + '/admin/shopgood/editState', //状态
  }`, //接口
  //列表
  table: {
    // isGenerate: "false", //false表示不生成页面
    table_name: "cur_goods_m_table2",  //表页面名
    nav_name: "商品库列表",  //导航名
    tipsText: "商品库管理 >> 商品库列表", //顶部文字
    // tableReqMethod: "get",  //分页请求配置成get方式, 默认为post
    // pageApi: "API.sys_setting.sys_setting_page",  //请求api
    // extraPageRequestParams: `
    //   courseId: this.$route.query.id,  //请求
    // `, //已有page和pageSize
    //获取列表页面
    tableData: [
      //普通
      { title: '序号', name: 'index', type: "normal" },
      { title: '商品名', name: 'name', type: "normal", itemWidth: "200" },
      {
        title: '类型',
        name: 'type',
        type: "opts",
        showName: "typeShow",
        showObj: `{
          "1": "普消",
          "2": "易物",
        }`
      },
      { title: '一级分类编码', name: 'catCode', type: "normal" },
      { title: '二级分类编码', name: 'superCode', type: "normal" },
      { title: '三级分类编码', name: 'classCode', type: "normal" },
      { title: '品牌', name: 'brandName', type: "normal" },
      { title: '成本价', name: 'floorPrice', type: "normal" },
      { title: '京东价格', name: 'price', type: "normal" },
      {
        title: '商品主图',
        name: 'imagePath',
        type: "img",
        heightVal: "60",
        widthVal: "100",
      },
      { title: '库存', name: 'inventory', type: "normal" },
      {
        title: '状态',
        name: 'state',
        type: "opts",
        showName: "stateShow",
        showObj: `{
          "1": "上架",
          "2": "下架",
        }`
      },
    ],
    tableOpt: [
      //编辑跳转
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/cur_goods_m_add_cur_goods"
      },
      //删除功能
      {
        type: "del",
        text: "删除",
        request: true,
        url: "API.cur_goods_m.del",
        requestType: 'get',
        // isSplitSearchString: 'true',  //拼接查询字符串（post需要，get不需要）。
      },

      {
        type: "changeState",
        text: "上架",
        request: true,
        url: "API.cur_goods_m.changeState",
        requestType: 'post',
        params: `{id,  state: 1 }`, //必须为文本 状态 1上架 2下架
        methodNameTag: 'Open', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '2'`,  //展示条件，没有就不传或置为空
      },
      {
        type: "changeState",
        text: "下架",
        request: true,
        url: "API.cur_goods_m.changeState",
        requestType: 'post',
        params: `{id,  state: 2 }`, //必须为文本
        methodNameTag: 'Close', //方法衔接拓展名 changeState Black
        showCondition: `scope.row.state == '1'`,  //展示条件，没有就不传或置为空
      },
    ],
    search: {
      contentArr: {
        input1: { labelName: '商品名称', inputName: 'name' },
        select1: {
          labelName: '类型',
          inputName: 'type',  //输入绑定的变量
          selectOptsName: "typeOpts",
          selectOptsArr: `[
            { value: "1", label: "普消" },
            { value: "2", label: "易物" },
            { value: "", label: "请选择" },
          ],
          `, //选项数组
        },
        select2_1: {
          labelName: '一级分类',
          inputName: 'catCode',  //输入绑定的变量
          selectOptsName: "catCodeOpts",
          selectOptsArr: `[
            { value: "", label: "请选择" },
          ],
          `, //选项数组
        },
        select2_2: {
          // labelWidth: "120",
          labelName: '二级分类',
          inputName: 'superCode',  //输入绑定的变量
          selectOptsName: "superCodeOpts",
          selectOptsArr: `[
            { value: "", label: "请选择" },
          ],
          `, //选项数组
        },
        select2_3: {
          labelName: '三级分类',
          inputName: 'classCode',  //输入绑定的变量
          selectOptsName: "classCodeOpts",
          selectOptsArr: `[
            { value: "", label: "请选择" },
          ],
          `, //选项数组
        },
      },
      //查找按钮的文字
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
      //添加按钮
      addBtn: {
        //搜索栏具有添加功能按钮时，设置此字段
        type: "add",
        text: "新增商品",
        request: false,
        jump: "/cur_goods_m_add_cur_goods", //添加的跳转按钮
      }
    },
  },



}

